import React from 'react';
import { connect } from 'dva';

import { Table } from 'antd';

@connect(({ accountMoveLine }) => ({ accountMoveLine }))
class List extends React.Component {
  state = {
  }

  treeview = [
      { title: '凭证号', dataIndex: 'move_id.name_cn', },
      { title: '名称', dataIndex: 'move_id.name', },
      { title: '日期', dataIndex: 'date', },
      { title: '科目代码', dataIndex: 'account_id.code', },
      { title: '科目名称', dataIndex: 'account_id.name', },
      { title: '明细科目', dataIndex: 'sub_account_id.code', },
      { title: '明细名称', dataIndex: 'sub_account_id.name', },
      { title: '借方', dataIndex: 'debit', },
      { title: '贷方', dataIndex: 'credit', },
      //{ title: '摘要', dataIndex: 'move_id.ref', },
      { title: '状态', dataIndex: 'move_id.state', },
      { title: '到期', dataIndex: 'date_maturity', },
  ]

  async componentDidMount() {
    const { dispatch } = this.props;
    await dispatch({
      type: 'accountMoveLine/search',
      payload: {domain:[], },

    });

  }

  render() {
    const { accountMoveLine: { recordsList } } = this.props;

    return (
      <div>
        <Table columns={this.treeview} dataSource={recordsList} rowKey="id" />

      </div>
    );
  }
}

export default List;





